// star.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。
//
#include<string>
#include<Windows.h>
#include <iostream>
#include<conio.h>
#include"star.h"
using namespace std;

int main()
{
	setcolor(15);
	cout << R"(
	         =================================================================================          
	        ==                                                                               ==         
	        ==                                                                               ==         
	        ==                                                                               ==         
	        ==                                                                               ==         
	        ==           =========================================================           ==         
	        ==           =                     一起来看流星雨                    =           ==         
	        ==           =                                                       =           ==         
	        ==           ====================---------------- ====================           ==         
	        ==                    =           |             |             =                  ==         
	        ==                   ===          |             |            ===                 ==         
	        ==                  =====         |   开始游戏  |           =====                ==         
	        ==            =================   |=-----------=|     =================          ==         
	        ==            =================   |             |     =================          ==         
	        ==              =============     |   排行榜    |       =============            ==         
	        ==                =========       |===-------===|         =========              ==         
	        ==                =========       |             |         =========              ==         
	        ==               ===== =====      |   设置      |        ===== =====             ==         
	        ==               ==       ==       =============         ==       ==             ==         
	        ==                                                                               ==         
	        ==                                                                               ==         
	        ==                                                                               ==         
	        ==                                                                               ==         
	        ==     =====================================================================     ==         
	        ==     ==                                                                 ==     ==         
	        ==     ==                     从0开始的1世界荣誉出品                      ==     ==         
	        ==     ==                  =============================                  ==     ==         
	        ==      ====================                           ====================      ==         
	        ==                                                                               ==         
	        ==                                                                               ==         
	         =================================================================================              
	                                                                                                    )";
	gotoxy(54, 12);
	short line_next = 12;int temp=0;
	short line_now = 12;
	string s[3] = { "开始游戏","排行榜","设置" };
	while (true) {
		int k = _kbhit();//判断键盘是否有输入
		//cout << k;
		if (k) {//如果有敲击返回1
			char c = (char)_getch();
			if ('s' == c&&temp<2) {
 				MoveCursor({ 54,line_now }, { 54,line_next+=3 }, s[temp++], s[temp],15,31);
				line_now += 3;
			}
			else if ('w' == c&&temp>0) {
				MoveCursor({ 54,line_now }, { 54,line_next -= 3 }, s[temp--], s[temp],15,31);
				line_now -= 3;
			}
		}

		Sleep(10);

	}


}

// 运行程序: Ctrl + F5 或调试 >“开始执行(不调试)”菜单
// 调试程序: F5 或调试 >“开始调试”菜单

// 入门使用技巧: 
//   1. 使用解决方案资源管理器窗口添加/管理文件
//   2. 使用团队资源管理器窗口连接到源代码管理
//   3. 使用输出窗口查看生成输出和其他消息
//   4. 使用错误列表窗口查看错误
//   5. 转到“项目”>“添加新项”以创建新的代码文件，或转到“项目”>“添加现有项”以将现有代码文件添加到项目
//   6. 将来，若要再次打开此项目，请转到“文件”>“打开”>“项目”并选择 .sln 文件
